﻿using System;

namespace SQLFileComparer
{
    class Program
    {
        static void Main(string[] args)
        {
            const string ckey = @"ABcC4iUsCmHuGPt8xQ34kBiF1rk9jymuyTlfvprDs56JWI+YDwU/BAHm2zt7qZbBVmyrEkiL8nHtUxnr
zUzGKmVd821+X4ASRtG3V7TtMx+jnWcuGKFV/WUdqrzrUze1H7DWHbYoQ/bsmMx31Jq9/x/6SC/kmBLE
B/UHYLTDJ/KaATcDFxZoelpwQoDU3inLYKud8AsH0YaeEhXBIeJBKHDZ3dJjuegJks7Vc1aS7ynLPAAJ
JjfnkjCwZQUAp1l4LxkP+gFXZ6bCk109Ml0wDCLs9eThOAI58kqhslTiCOt0XEQ9gvQodNRaRpLZqmDT
gFniFLJ0lvYW1Qi2tbVR4ItyyNUY8oktw4AQh/FwYEjqzjH7//Q5AMVNJqzscb8fCGYHZuGKuo3PtVAx
ZA8FpnW/zOeDVuCWOccPyszcQVHB8X+KaflmXxOkK0qjB5y2R382LKXXm7GGcCwZeu/A8nP/b3OPez18
WWzT3iqV8jErWYNMpRSs6lXNA/jMTOUj4znWpJgpJsxCutM4A7yH8X777iBsdE1fU4UdwnhErwyHsPvx
vk2ZAjO2CutBc+aYRhJ60V7Etm/sd1ESC2RU/QrHsVPBlTIwYevttmphHt+fhXtmyt6tw/mMBUf8hvfO
YgzhecKS1rDfSW9y1gAFillxc4Xo7TIrGe5aNZDqNNv0HlNdgKQdDa/KhoBvOuz4h3ruihJx5XTatV/U
N6Eg9BWUfretpwm0VGbWHmexvN8BYq4V/KrIgjneg8tESdUNqpFr2rw0St9wOTWsm8cNKPiA0tXzCvdr
y/t+zyQ+bwuQyHTWRuEjzRfOpMN0HOdx0VrSxHcAGp+ZAA/AtXu6MskqG9JSN+IWXQS+JGY09q8TDf7K
a6uTkK7VPEXSYhebFHL5SgAVHpl4vGdyQvY5ZAlgrah98MYeloskffqcRPrsIg/zO6yu/u5kUa9DIU64
m9c8cbVvHiSr2rN18KCf3HdshR/mRSlcsa66GZ4W2nU9bOIjX9JFfQTrR2D5OQ1NxXU415su0Vat378G
tASFlQA+N4S+e3ykJggb+v3JY3igbVQp3gPaDpqMdX8SP8j/ZrJgugGJjkn4k7CSE9dY5HxHZUewW7b8
YynqMgb8kec/G5NKaKh2F94KMUtTR/rCM5ADy9mATwr8ZFbYn1xD+wHIUvhDDXvT0E5ppSprqBwuJ/51
+MYOvsyJTgRRnneCxzVJi/QCfyYVMPqKF6ngkbs6qXddzQM7upQrur92gTLX5931IR0nK6jYYMjLg6ci
qL1JF/T/JPkyDtFg1sRnnq/IszDL62+dEn3PhG06bzbsCREBLWk918LjwxJMx1XjccIYA893Vr1NqwV3
MJ+M9w==";
            var actionParams = new ActionParams { Debug = false, Key = ckey, PartSize = 1000 };

            Console.WriteLine("begin code");
            var o = new ForwardProcessor(actionParams);
            o.Process("D:\\Projects\\", "*.*");
            o.SaveToFile("D:\\Test\\res.dat");

            Console.WriteLine("begin decode");
            var b = new BackProcessor(actionParams);
            b.Process("D:\\Test\\res.dat", "D:\\Test\\OUT");
            b.SaveToFile("D:\\Test\\res.res");

            //var key = new byte[1024];
            //var rand = new Random();
            //rand.NextBytes(key);
            //Console.WriteLine(Convert.ToBase64String(key));

            Console.WriteLine("Done");
            Console.ReadLine();
        }
    }
}
